﻿
using MvcTest004.Data;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;

namespace MVCtest.Models
{
    public class MusicStoreInitializer:CreateDatabaseIfNotExists<MusicStoreDB>
    {

        protected override void Seed(MusicStoreDB context)
        {

            context.Artists.Add(new Artist { Name = "Lao Hu" });
            context.Genres.Add(new Genre { Name = "DJ" });
            context.Albums.Add(new Album
            {

                Artist = new Artist { Name = "Hu Zong" },
                Genre = new Genre { Name = "Heavy Metal" },
                Price = 9.9m,
                Title = "死亡摇滚",
                AlubmArtUrl = "老胡天团"



            });

            base.Seed(context);
        }
    }
}